import time

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.edge.service import Service

if __name__ == '__main__':
    exe_path = "../driver/msedgedriver.exe"
    service = Service(executable_path=exe_path)
    brower = webdriver.Edge(service=service)

    brower.get(url="https://www.taobao.com")

    # 通过 id 查找元素
    element = brower.find_element(by=By.ID, value="q")
    print(element)

    # 获取元素属性的值
    name = element.get_property(name="name")
    print(name)

    name = element.get_attribute(name="name")
    print(name)

    id = element.get_property(name='id')
    print(id)

    brower.quit()
